home *** CD-ROM | disk | FTP | other *** search
/ POINT Software Programming / PPROG1.ISO / pascal / swag / mouse.swg / 0016_What PORT is Mouse on.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1994-01-27  |  2.0 KB  |  50 lines

  1. {************************************************************}
  2. PROGRAM WhatPortIsTheMouseOn;   { Sept 18/93, Greg Estabrooks}
  3. TYPE
  4.     MouseParamTable = RECORD
  5.                         BaudRate   :WORD; { Baud Rate Div 100}
  6.                         Emulation  :WORD;
  7.                         ReportRate :WORD; { Report Rate.     }
  8.                         FirmRev    :WORD;
  9.                         ZeroWord   :WORD; { Should be zero.  }
  10.                         PortLoc    :WORD; { Com Port Used.   }
  11.                         PhysButtons:WORD; { Physical Buttons.}
  12.                         LogButtons :WORD; { Logical Buttons. }
  13.                       END;
  14. VAR
  15.    MouseInf :MouseParamTable;
  16.  
  17. PROCEDURE GetMouseInf( VAR MouseTable ); ASSEMBLER;
  18.                        { Routine to Get info about mouse.   }
  19.                        { NOTE Doesn't check to see if a     }
  20.                        {  a mouse is installed.             }
  21. ASM
  22.   Push AX                      { Save Registers Used.       }
  23.   Push ES
  24.   Push DX
  25.   Mov AX,$246C                 { Get Mouse Parameters.      }
  26.   LES DX,MouseTable            { Point ES:DX to Param Table.}
  27.   Int $33                      { Call Mouse Interrupt.      }
  28.   Pop DX                       { Restore Registers used.    }
  29.   Pop ES
  30.   Pop AX
  31. END;{GetMouseInf}
  32.  
  33. BEGIN
  34.   GetMouseInf(MouseInf);        { Get mouse info.            }
  35.   Writeln('     ___Mouse Info___'); { Show a title.          }
  36.   Writeln;
  37.   WITH MouseInf DO              { Display Mouse Info.        }
  38.     BEGIN
  39.       Writeln('Baud Rate     : ',BaudRate * 100);
  40.       Writeln('Emulation     : ',Emulation);
  41.       Writeln('Report Rate   : ',ReportRate);
  42.       Writeln('FirmWare Rev  : ',FirmRev);
  43.       Writeln('Com Port      : ',PortLoc);
  44.       Writeln('Physical Butns: ',PhysButtons);
  45.       Writeln('Logical Buttns: ',LogButtons);
  46.     END;
  47.   Readln;                       { Wait for user to have a look.}
  48. END.{WhatPortIsTheMouseOn}
  49. {************************************************************}
  50.